<?php
/**
 * Created by 云中有鹿.
 * User: 陈云
 * Blog: http://blog.likecy.cn
 * Date: 2019-04-05
 * Time: 19:36
 */

namespace app\car\controller;
use app\common\controller\Api;
use app\common\library\Auth;
use think\Config;
use think\Lang;

//use app\common\controller\Api;

class CarApiBase extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];
    //设置返回的会员字段
    protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar'];

    public function _initialize()
    {
        parent::_initialize();

//        Config::set('default_return_type', 'json');
        Auth::instance()->setAllowFields($this->allowFields);

        //这里手动载入语言包
//        Lang::load(ROOT_PATH . '/addons/cms/lang/zh-cn.php');
        Lang::load(APP_PATH . '/index/lang/zh-cn/user.php');
    }
}